package cn.yunyichina.provider.finance.common;

import cn.yunyichina.provider.finance.creator.FinanceAccountJournalCreator;
import cn.yunyichina.provider.finance.creator.journal.DepositOrderJournal;
import cn.yunyichina.provider.finance.creator.journal.InquiryOrderJournal;
import cn.yunyichina.provider.finance.creator.journal.SurgeryOrderJournal;
import cn.yunyichina.provider.finance.entity.BoneOrderBo;

/**
 * 订单流水工厂
 * 
 * @author zhou
 *
 */
public class FinanceAccountJournalOrderFactory {
	
	public static FinanceAccountJournalCreator acreate(BoneOrderBo boneOrderBo) throws Exception {
		short orderType = boneOrderBo.getOrderType();
		if (orderType == 91) {
			return new InquiryOrderJournal(boneOrderBo);
		} else if (orderType == 92) {
			return new SurgeryOrderJournal(boneOrderBo);
		} else if (orderType == 93) {
			return new DepositOrderJournal(boneOrderBo);
		} else {
			throw new Exception("无效的订单类型 orderType: " + orderType);
		}
	}
}
